/**
 * @author nttdocomo
 */
define(function(require) {
	aries.augmentString("aries.form.FieldAncestor", aries.Class.extend({
		/**
		 * Initializes the FieldAncestor's state; this must be called from the initComponent method of any components
		 * importing this mixin.
		 * @protected
		 */
		initFieldAncestor : function() {
			var me = this, onSubtreeChange = me.onFieldAncestorSubtreeChange;

			// Catch addition and removal of descendant fields
			me.on('add', onSubtreeChange, me);
			me.on('remove', onSubtreeChange, me);

			me.initFieldDefaults();
		},

		/**
		 * @private Initialize the {@link #fieldDefaults} object
		 */
		initFieldDefaults : function() {
			if (!this.fieldDefaults) {
				this.fieldDefaults = {};
			}
		}
	}));
})
